package ch09.shili;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class S04 {

    public static void main(String[] args) throws IOException {
        //读取文件内容
        InputStream fis = new FileInputStream("data/test2.txt");
        System.out.println("可读取的字节数:"+fis.available());
        while (true){
            int data = fis.read();
            if(data == -1){
                break;
            }
            char word = (char)data;
            System.out.println(data+"\t"+word);
        }
        fis.close();
    }
}
